home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / lang / dial_cde.hqx / about dial cdef next >
Encoding:
Text File  |  1988-09-15  |  2.7 KB  |  56 lines

  1. September 15, 1988
  2. Dial CDEF version 1.0
  3.  
  4. About the Dial CDEF sources...
  5.  
  6. The Dial CDEF comes in two stuffit'd packages.  One contains the LSC 3.0 source,
  7. the other a small sample application which uses the CDEF resource in its
  8. resource fork, and illustrates the standard ControlManager calls.  If you
  9. click on the white-on-black title area at the bottom of the CDEF, you can
  10. drag the control around on the screen.  (I didn't bother to include source
  11. for the sample application since it is so small, hope that's ok).
  12.  
  13. I hacked the Dial CDEF together over a few days to see whether it was worth
  14. the trouble, after reading the artitle in MacTutor.  As I stated in my posting,
  15. I really don't see any advantage in using CDEF's rather than a library, but I 
  16. promptly got half a dozen letters asking me to post it anyway-- maybe other
  17. people can see advantages where I can't.  Tell me if you do!
  18.  
  19. CDEFs are poorly documented.  After rolling the code into CDEF form I put a
  20. Debugger call just inside the entry point to see the order of messages and the
  21. value of param, and traced what routines got called.  This clarified some
  22. things and left others murky.  The biggest problem was that param contains
  23. a short int value with garbage in the high word on two calls, which was not
  24. documented.  If you blithely test the whole long word for non-zero values, as
  25. I did at first, you almost always get a non-zero value and do the wrong thing.
  26.  
  27. This is not guaranteed to be robust code.  I made a minimal attempt to make sure
  28. things behave reasonably under low memory conditions, but have not tested it
  29. thoroughly (with heap scramble, low memory, etc).  Use it as an example and be
  30. prepared to fix bugs.
  31.  
  32. Also note that you may need to change the include statements in some files.  My
  33. file organization has lots of utility source in a separate folder.  Just edit
  34. accordingly.  Other than that, to build the CDEF just link with MacTraps.
  35.  
  36. The main thing missing in my opinion is no numbers on the dial itself.  I wrote
  37. numbers into a dial-like library that I will use instead of a CDEF (among other
  38. things, I get to use floating point values this way) and it is pretty easy to
  39. do.  All the floating point code is slow on a plus (I develop on a II) and even
  40. redrawing the dials to deactivate them on a II takes a noticable amount of time.
  41. I haven't bothered to speed things up.  Besides these improvements, you can always
  42. add color too, but you will have to replace the offscreen drawing code.
  43.  
  44. So here it is.  I hope it's useful as an example, and perhaps you can find some
  45. real use for it.  Enjoy!
  46.  
  47. Doug Felt
  48. Courseware Authoring Tools Project
  49. Sweet Hall 3rd Floor
  50. Stanford University
  51. Stanford, CA 94305
  52. duggie@jessica.stanford.edu
  53.  
  54.  
  55. P.S. And you get my b/w offscreen drawing code (also not debugged) for free! 
  56. What a deal!